function mutator(key, value, modelName){
	if(endWith(key, "_radio")){
		$("div[value="+value+"][class*=upload_radio] ins").attr("class","checked");
	}
	$("#"+key).val(value);
	$("#"+key).attr("oldValue", value);
	$("#"+key).attr("plug_Name", modelName);
}
function endWith(srcStr, indexStr){
	if(srcStr == null || indexStr == null){
 		return false;
	}
	if(srcStr.length < indexStr.length){
 		return false;
	}else if(srcStr == indexStr){
 		return true;
	}else if(srcStr.substring(srcStr.length - indexStr.length) == indexStr){
 		return true;
	}
	return false;
}
function loopMutator(plug_list){
	for(var i=0; i<plug_list.length; i++){
		var jsonObj = plug_list[i].plugParamList;
		for(var item in jsonObj){
			mutator(item, jsonObj[item], plug_list[i].plugName);
		}
   	}
}
//获取所有已经改变的值
function getAllChangeValues(){
	var arr = new Array();
	var plugList ={};
	$("input[plug_Name]").each(function () {
		var plugTempList = {};
		if($(this).val() != $(this).attr("oldValue")){
			//获取plug_param_list中的key
			//获取plug_Name的值
			var idStr =$(this).attr("id");
			var plugName = $(this).attr("plug_Name"); 
			//判断最外层是否有该plugName的对象
			if(typeof(plugList[plugName]) == "undefined"){
				//plug_Name赋值
				plugTempList.plug_Name = plugName;
				//plug_param_list 对象的组建
				var plugParamList = {};
				plugParamList[idStr] = $(this).val();
				plugTempList.plug_param_list = plugParamList;
			}else{
				//有该对象  则将该key装入List
				plugTempList = plugList[plugName];
				plugTempList.plug_param_list[idStr] = $(this).val();
			}
			//将其按照plugName为对象  进行装载
			plugList[plugName] = plugTempList;
		}
	})
	//将对象 转换为数组
	for(var item in plugList){
		arr.push(plugList[item]);
	}
	return arr;
}